package com.sfac.javaSpringBoot.modules.common.entity;

/**
 * @Description Result
 * @Author HymanHu
 * @Date 2021/9/13 14:11
 */
public class Result<T> {

    private int code;
    private String message;
    private T object;

    public Result() {
    }

    public Result(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public Result(int code, String message, T object) {
        this.code = code;
        this.message = message;
        this.object = object;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getObject() {
        return object;
    }

    public void setObject(T object) {
        this.object = object;
    }

    public enum ResultCode {
        SUCCESS(200),
        FAILED(500);
        public int code;

        ResultCode(int code) {
            this.code = code;
        }
    }
}
